<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<body>
	<ui:composition template="/template/template.xhtml">
		<ui:define name="body">										
			<h:form onkeypress="if (event.keyCode == 13) return false;">
								
				<rich:notifyMessages stayTime="5000" nonblocking="true" />														              			
				
				<rich:extendedDataTable id="dataTable" width="100%" rows="15" frozenColumns="3"
					value="#{ineffectiveMachineBean.commandCheckDisplayList}" var="commandCheckDisplay" iterationStatusVar="it">
					
					<f:facet name="header">
		                <h:outputText value="#{msg.ineffective_machine_report}" />
		            </f:facet>
					
					<rich:column width="40px">
						<f:facet name="header">
			                <h:outputText value="#{msg.index_logo}" />
			            </f:facet>						 
						<h:outputText value="#{it.index + 1}" />						
					</rich:column>
					
					<rich:column width="210px"
						sortBy="#{commandCheckDisplay.nid}"
						sortOrder="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_nid']}">
						
						<f:facet name="header">			                
			                <h:panelGrid columns="2">
								<a4j:commandLink style="color:#FFFFFF" styleClass="tableTitle"
									value="#{msg.nid}" render="@form"
									action="#{ineffectiveMachineBean.sort}" execute="@this" immediate="true" > 									
									<f:param name="sortProperty" value="commandCheckDisplay_nid" />							
								</a4j:commandLink>

								<h:graphicImage library="images" name="icons/down_icon.gif"
									rendered="#{ineffectiveMachineBean.sortsOrders['errorDetail_nid']=='descending'}" />

								<h:graphicImage library="images"
									name="icons/up_icon.gif.gif"
									rendered="#{ineffectiveMachineBean.sortsOrders['errorDetail_nid']=='ascending'}" />

							</h:panelGrid>
			            </f:facet>		
						<h:outputText value="#{commandCheckDisplay.nid}" />
					</rich:column>	
					
					<rich:column width="300px"
						sortBy="#{commandCheckDisplay.realTimeControl.temperature}"
						sortOrder="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_realTime_temperature']}">
						
						<f:facet name="header">			                
			                <h:panelGrid columns="2">
								<a4j:commandLink style="color:#FFFFFF" styleClass="tableTitle"
									value="#{msg.temperature}" render="@form"
									action="#{ineffectiveMachineBean.sort}" execute="@this" immediate="true" > 									
									<f:param name="sortProperty" value="commandCheckDisplay__realTime_temperature" />							
								</a4j:commandLink>

								<h:graphicImage library="images" name="icons/down_icon.gif"
									rendered="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_realTime_temperature']=='descending'}" />

								<h:graphicImage library="images"
									name="icons/up_icon.gif.gif"
									rendered="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_realTime_temperature']=='ascending'}" />

							</h:panelGrid>
			            </f:facet>								
						<h:outputText value="#{commandCheckDisplay.realTimeControl.temperature}" />
					</rich:column>	
					
					<rich:column width="400px"
						sortBy="#{commandCheckDisplay.cmdTime}"
						sortOrder="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_cmdTime']}">
						
						<f:facet name="header">			                
			                <h:panelGrid columns="2">
								<a4j:commandLink style="color:#FFFFFF" styleClass="tableTitle"
									value="#{msg.command_time}" render="@form"
									action="#{ineffectiveMachineBean.sort}" execute="@this" immediate="true" > 									
									<f:param name="sortProperty" value="commandCheckDisplay_cmdTime" />							
								</a4j:commandLink>

								<h:graphicImage library="images" name="icons/down_icon.gif"
									rendered="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_cmdTime']=='descending'}" />

								<h:graphicImage library="images"
									name="icons/up_icon.gif.gif"
									rendered="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_cmdTime']=='ascending'}" />

							</h:panelGrid>
			            </f:facet>								
						<h:outputText value="#{commandCheckDisplay.cmdTime}"/>
					</rich:column>
					
					<rich:column width="300px"
						sortBy="#{commandCheckDisplay.currentControl.roomTemperature}"
						sortOrder="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_currentControl_roomTemperature']}">
						
						<f:facet name="header">			                
			                <h:panelGrid columns="2">
								<a4j:commandLink style="color:#FFFFFF" styleClass="tableTitle"
									value="#{msg.room_temperature}" render="@form"
									action="#{ineffectiveMachineBean.sort}" execute="@this" immediate="true" > 									
									<f:param name="sortProperty" value="commandCheckDisplay_currentControl_roomTemperature" />							
								</a4j:commandLink>

								<h:graphicImage library="images" name="icons/down_icon.gif"
									rendered="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_currentControl_roomTemperature']=='descending'}" />

								<h:graphicImage library="images"
									name="icons/up_icon.gif.gif"
									rendered="#{ineffectiveMachineBean.sortsOrders['commandCheckDisplay_currentControl_roomTemperature']=='ascending'}" />

							</h:panelGrid>
			            </f:facet>								
						<h:outputText value="#{commandCheckDisplay.currentCmd}" rendered="#{commandCheckDisplay.currentCmd == 'E3'}"/>
						<h:outputText value="#{commandCheckDisplay.currentControl.roomTemperature}" rendered="#{errorDetail.realTimeControl.errorMessage != 'E3'}"/>
					</rich:column>
					

		            
		            <f:facet name="footer">
		            	<h:commandButton styleClass="buttonClass" style="font-size: 16px;" 
							value="#{msg.excel}" 
							actionListener="#{ineffectiveMachineBean.genExcel}" 
							rendered="#{not empty ineffectiveMachineBean.commandCheckDisplayList}" />
						<h:outputText value="&#160;" /> 
						<h:outputText value="&#160;" /> 
						<h:outputText value="&#160;" />
		                <rich:dataScroller page="#{ineffectiveMachineBean.page}" />
		            </f:facet>
					
				</rich:extendedDataTable>

			</h:form>						
			    
		</ui:define>
	</ui:composition>
</body>
</html>
